package com.example.demo.Mappers;

import com.example.demo.beans.GetOrderListResponseitem;
import com.example.demo.beans.OrderPatientInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by Administrator on 2018-04-24.
 */
@Mapper
public interface ExecGetOrderRegMapper {
    @Select("select  (Select CONVERT(varchar(100), OrderDate, 23))OrderDate ,TypeID,TypeName, DeptName, DoctID,DoctName, RankName, RegID,AppFee,RegFee,TreatFee,OtherFee,TimeRegion,Specialty,(case IsAvailable when '0' then '未取号' else'已取号'end)IsAvailable,RegWay,(case IsPay when '1' then'已付费'else '未付费' end)IsPay from AutoOrderList nolock where RegID=#{RegID}")
    GetOrderListResponseitem getOrerinfo(@Param("RegID")String RegID);
    @Update("update AutoOrderList set IsPay='1',IsAvailable='1' where yyghid=#{yyghid}")
    void updateorderlist(@Param("yyghid")String yyghid);
    @Select("select rtrim(yyghid)yyghid,rtrim(ywckbm)ywckbm,rtrim(brid)brid,rtrim(czybm)czybm,yyghrq,rtrim(brxm)brxm,rtrim(brxb)brxb,brsr ,rtrim(brnl)brnl,rtrim(sfzh)sfzh,rtrim(jtzz)jtzz,rtrim(sj)sj,rtrim(yyys)yyys,rtrim(yyks)yyks,yydjrq,rtrim(czyks)czyks,rtrim(yyjfbz)yyjfbz,rtrim(ylkh)ylkh,rtrim(yyclbz)yyclbz from  ghb_yygh  nolock where yyghid=#{yyghid}")
    OrderPatientInfo selectorderpatientinfo(@Param("yyghid")String yyghid);
    @Update("update ghb_yygh set yyjfbz='1' where yyghid=#{yyghid}")
    void UpdateOrderPay(@Param("yyghid")String yyghid);
}
